Skip to content

Conversation

@laspsandoval
Copy link
Contributor

@laspsandoval laspsandoval commented Dec 10, 2025

Change Summary

Overview

Formatting to get codice_lo into a format that can be inserted into DynamoDB.

Updated Files

  • process_codice.py
    • Formatting to get codice_lo into a format that can be inserted into DynamoDB.

Testing

  • test_process_codice.py

@laspsandoval laspsandoval self-assigned this Dec 10, 2025
@laspsandoval laspsandoval added Ins: CoDICE Related to the CoDICE instrument Level: L2 Level 2 processing I-ALiRT labels Dec 10, 2025
@laspsandoval laspsandoval added this to the December 2025 milestone Dec 10, 2025
Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few suggestions that I think might make this a little cleaner without all the case handlings.

  • Stick to numpy arrays. So try to initialize an empty array with the expected shape.
    pseudo_density_arr = np.empty((len(constants.LO_IALIRT_VARIABLE_NAMES), len(intensity))
    Then you can ignore the division by zero and let nan's fall out automatically and replace with fills later if you want. (remove all if 0 branches)

  • Use an IntEnum for your species names. Then you can lookup into arrays with pseudo_density_arr[LoSpecies.O_7_plus, :] rather than pseudo_density_dict[species_list[3]] with kind of two redirects in there which is confusing for me to follow without looking back up what index is what in the species list.

Comment on lines 328 to 330
pseudo_density_dict[species_list[3]]
+ pseudo_density_dict[species_list[4]]
+ pseudo_density_dict[species_list[5]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I commented on this somewhere else earlier but couldn't find it immediately. I think this would be much easier to follow with an IntEnum to index into the named species.

class Species(IntEnum):
    OXYGEN = 0
    CARBON2 = 1
    ...

pseudo_density_arr[Species.OXYGEN]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. It's not too readable. I decided to just write out the names.

@subagonsouth subagonsouth removed this from the December 2025 milestone Jan 5, 2026
@laspsandoval
Copy link
Contributor Author

@greglucas sorry it took me so long to get back to this. Would you mind looking it over again?

@laspsandoval laspsandoval requested a review from greglucas January 5, 2026 19:05
Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, much easier to read with string names, thank you for updating that!

@laspsandoval laspsandoval merged commit e71b60e into IMAP-Science-Operations-Center:dev Jan 5, 2026
13 of 14 checks passed
@laspsandoval laspsandoval deleted the update_codice_l2 branch January 5, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-ALiRT Ins: CoDICE Related to the CoDICE instrument Level: L2 Level 2 processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants